package cn.webestar.scms.user.svcapi;

import cn.webestar.scms.commons.R;
import cn.webestar.scms.commons.api.PageVO;
import cn.webestar.scms.microsvc.controller.BaseController;
import cn.webestar.scms.user.api.SysConfigApi;
import cn.webestar.scms.user.api.dto.SysConfig.*;
import cn.webestar.scms.user.entity.SysConfig;
import cn.webestar.scms.user.service.SysConfigService;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 系统级配置
 */
@RestController
@RequestMapping("/svcapi/SysConfig")
public class SysConfigSvcController extends BaseController<SysConfig, Long> implements SysConfigApi {

    @Autowired
    private SysConfigService service;

    @Override
    public IService<SysConfig> getService() {
        return service;
    }

    @Override
    @PostMapping("/delete")
    public R<Boolean> delete(@RequestParam("id") Long id) {
        return super._delete(id);
    }

    @Override
    @PostMapping("/findById")
    public R<SysConfig> findById(@RequestParam("id") Long id) {
        return super._findById(id);
    }

    @Override
    @PostMapping("/findByIds")
    public R<Map<Long, SysConfig>> findByIds(@RequestBody Set<Long> ids) {
        return super._findByIds(ids);
    }

    @Override
    @PostMapping("/create")
    public R<SysConfig> create(@RequestBody SysConfigCreateDTO body) {
        return super._create(body);
    }

    @Override
    @PostMapping("/update")
    public R<SysConfig> update(@RequestBody SysConfigUpdateDTO body) {
        return super._update(body);
    }

    @Override
    @PostMapping("/page")
    public R<PageVO<SysConfig>> page(@RequestBody SysConfigPageDTO body) {
        return super._page(body);
    }

    @Override
    @PostMapping("/findOne")
    public R<SysConfig> findOne(@RequestBody SysConfigSimpleDTO body) {
        return super._findOne(body);
    }

    @Override
    @PostMapping("/limitList")
    public R<List<SysConfig>> limitList(@RequestBody SysConfigLimitDTO body) {
        return super._limitList(body);
    }

}
